package com.offcn.service;

import com.offcn.entity.Book;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Component
@FeignClient(value = "nacos-payment-provider")
public interface OpenFeignService {
    @DeleteMapping(value = "/book/delete/{id}")
    public int delete(@PathVariable("id") int id);
    @PutMapping(value = "/book/put/")
    public int update(@RequestBody Book book);

    @PostMapping(value = "/book/post/")
    public int add(@RequestBody Book book);

    @GetMapping(value = "/book/get/")
    public List<Book> select();
    @GetMapping(value = "/book/get/{id}")
    public Book selectOne(@PathVariable("id") int id);

    @PostMapping("/user/post/")
    public int add(@RequestBody User user);

    @DeleteMapping("/user/delete/{id}")
    public int delete(@PathVariable int id);

    @GetMapping("/user/get/")
    public List<User> select();

    @PutMapping("/user/put/")
    public int update(@RequestBody Address address);
}
